﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Security.Cryptography;

namespace IntelFront.Agent
{
    public class Config
    {
        protected string host { get; set; }
        protected string port { get; set; }
        public string url { get; set; }
        public string PIN;
        protected string secret;

        public Config()
        {
            this.host = "http://139.129.131.240";
            this.port = "5000";
            this.url = host +":" + port;
            this.secret = "OurEDA_Intel";
            //this.PIN = generatePIN(secret);
            this.PIN = "uCiZShHe0P0MORhRvrSx2AqWpBA=";
        }

        protected string generatePIN(string sec)
        {
            SHA1 sh1 = new SHA1CryptoServiceProvider();
            byte[] byteResult = sh1.ComputeHash(System.Text.Encoding.Default.GetBytes(sec));
            return Convert.ToBase64String(byteResult);
        }
    }
}
